package com.woniuxy.servcie.impl;

import com.woniuxy.dao.RbacManagerDao;
import com.woniuxy.entity.RbacManager;
import com.woniuxy.servcie.RbacMangerServcie;

import java.util.List;
import java.util.Map;

/**
 * @author 佘赛飞
 * @create 2021 -11 -16 5:15 PM
 */
public class RbacMangerServcieImpl implements RbacMangerServcie {

    RbacManagerDao managerDao;

    public RbacManagerDao getManagerDao() {
        return managerDao;
    }

    public void setManagerDao(RbacManagerDao managerDao) {
        this.managerDao = managerDao;
    }

    public void addOn() {
        RbacManager rbacManager = new RbacManager();
        rbacManager.setAccount("qig11");
        rbacManager.setPassword("123123");
        rbacManager.setStatus("j");
        rbacManager.setRoleId(11);
        int i = managerDao.addManager(rbacManager);

        //int d =1/0;
        rbacManager.setStatus("z");
        int j = managerDao.addManager(rbacManager);

        if (i > 0) {
            System.out.println("新增成功！");
        } else {
            System.out.println("RbacMangerServcieImpl.addOn执行失败！");
        }
    }


    public Map findOne() {
        System.out.println("RbacManagerServiceImpl.findOne");
        return null;
    }


    public List<Map<String, String>> findAllOne() {
        System.out.println("RbacManagerServiceImpl.findAllOne");
        return null;
    }

    public int deleteOne(int id) {
        System.out.println("RbacManagerServiceImpl.deleteOne,现在获取到的id是多少：" + id);
        return 0;
    }
}
